﻿namespace Bookworm.Core
{
    public abstract class FrameSerializer<T>
    {
        public abstract T Serialize(Frame frame);
        public abstract Frame Deserialize(T data);

        public TFrame DeserializeAs<TFrame>(T data)
            where TFrame : Frame
        {
            Frame frame = Deserialize(data);
            return frame as TFrame;
        }
    }
}
